package pack;

import java.io.Serializable;
import java.util.Calendar;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 * the class implements the questions.
 * @author 王舒嶷
 */
public class Question implements Serializable {

    // Constructors
    public Question(){
    }

    public Question(int question_id, String title, String body, int type, int course_id, int user_id, Calendar created) {
        this(question_id, title, body, type, user_id, created);
        this.course_id = course_id;
    }

    public Question(int question_id, String title, String body, int type, int user_id, Calendar created) {
        this.question_id = question_id;
        this.title = title;
        this.body = body;
        this.type = type;
        this.user_id = user_id;
        this.course_id = -1;
        this.created = (Calendar) created.clone();
        this.modified = (Calendar) created.clone();
    }

    // Mutator and Accessor
    public int getQuestion_id() {
        return this.question_id;
    }

    public void setQuestion_id(int question_id) {
        this.question_id = question_id;
    }

    public String getTitle() {
        return this.title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getBody() {
        return this.body;
    }

    public void setBody(String body) {
        this.body = body;
    }
    
    public int getType(){
        return this.type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public int getCourse_id() {
        return this.course_id;
    }

    public void setCourse_id(int course_id) {
        this.course_id = course_id;
    }

    public int getUser_id() {
        return this.user_id;
    }

    public void setUser_id(int user_id) {
        this.user_id = user_id;
    }

    public Calendar getCreated() {
        return (Calendar) created.clone();
    }

    public void setCreated(Calendar created) {
        this.created = (Calendar) created.clone();
    }

    public Calendar getModified() {
        return (Calendar) modified.clone();
    }

    public void setModified(Calendar modified) {
        this.modified = (Calendar) modified.clone();
    }
    // fields
    private int question_id;
    private String title;
    private String body;
    private int type;
    private int course_id;
    private int user_id;
    private Calendar created;
    private Calendar modified;
}
